package mumu.android.monitoring;

import com.nd.pad.sdk.usercenter.db.dao.KeyValueTableDao;

import mumu.android.MumuActivity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BootBroadCastReceiver extends BroadcastReceiver {

	static final String ACTION = "android.intent.action.BOOT_COMPLETED";
	static final String SHUT_ACTION = "android.intent.action.ACTION_SHUTDOWN";

	@Override
	public void onReceive(Context context, Intent intent) {

		if (intent.getAction().equals(ACTION)) {
			KeyValueTableDao.getInstance(context).put(ACTION + "open", System.currentTimeMillis() + "");
			mumu.android.lib.tool.MLog.d("dd", "BootBroadCastReceiver");
			// Intent sayHelloIntent = new Intent(context, MumuActivity.class);
 
			// sayHelloIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

			// context.startActivity(sayHelloIntent);
		} else if (intent.getAction().equals(SHUT_ACTION)) {
			KeyValueTableDao.getInstance(context).put(ACTION + "shutdown", System.currentTimeMillis() + "");
		}
	}
}
